import java.io.Serializable;

public class Book implements Serializable {
    private String title;
    private String author;
    private int price;

    public Book(String title, String author, int price) {
        this.title = title;
        this.author = author;
        this.price = price;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public int getPrice() {
        return price;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setPrice(int price) {
        this.price = price;
    }
    //重写一下toString函数,方便打印
    @Override
    public String toString() {
        return "《" + title + "》 作者: " + author + " (" + price + "元)";
    }
}
